#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 2e5+10;

int a[N],n,tr[N],m;

struct node{
	int arr[55];
	const int operator [](int x)const{return arr[x];}
	int & operator [](int x){return arr[x];}
	void clear(){memset(arr,0,sizeof(arr));}
	void insert(int x){
		for(int i = 30;~i;i--){
			if(x >> i & 1){
				if(!arr[i]){
					arr[i] = x;
					return;
				}else x ^= arr[i];
			}
		}
	}
	friend node operator + (node x,node y){
		node ans = x;
		for(int i = 30;~i;i--){
			if(y[i])
				ans.insert(y[i]);
		}return ans;
	}
}val[N<<2];

void upd(int x,int y){for(;x<=n;x+=x&-x)tr[x]^=y;}
int sum(int x){int res = 0;for(;x;x-=x&-x)res^=tr[x];return res;}

void build(int o = 1,int l = 1,int r = n){
	if(l == r){
		val[o].insert(a[l]);return;
	}
	int mid = l+r>>1;
	build(o<<1,l,mid); build(o<<1|1,mid+1,r);
	val[o] = val[o<<1] + val[o<<1|1];
}

void update(int pos,int v,int o = 1,int l = 1,int r = n){
	if(l == r){
		val[o].clear(); val[o].insert(v);return;
	}
	int mid = l+r>>1;
	if(pos <= mid) update(pos,v,o<<1,l,mid);
	else if(pos > mid) update(pos,v,o<<1|1,mid+1,r);
	val[o] = val[o<<1] + val[o<<1|1];
}

node query(int xl,int xr,int o = 1,int l = 1,int r = n){
	if(xl == l && xr == r) return val[o];
	int mid = l+r>>1;
	if(xr <= mid) return query(xl,xr,o<<1,l,mid);
	else if(xl > mid) return query(xl,xr,o<<1|1,mid+1,r);
	else return query(xl,mid,o<<1,l,mid) + query(mid+1,xr,o<<1|1,mid+1,r);
}

void change(int pos,int x){if(pos > n) return;a[pos] ^= x; update(pos,a[pos]); upd(pos,x);}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in;
	for(int i = 1;i <= n;i++) a[i] = in;
	for(int i = n;i >= 1;i--) a[i] ^= a[i-1],upd(i,a[i]);
	build();
	while(m--){
		int op = in,l = in,r = in,k;
		if(op == 1){
			k = in;
			change(l,k); change(r+1,k);
		}else{
			node tot; tot.clear();
			if(l < r) tot = query(l+1,r);
			tot.insert(sum(l));
			int ans = 1;
			for(int i = 30;~i;i--) if(tot[i]) ans <<= 1;
			printf("%d\n",ans);
		}
	}			
	return 0;
}

